package com.snail.controller;

import com.snail.model.entity.AddBizTaskAuditRequest;
import com.snail.response.BaseResponse;
import com.snail.response.ResultUtils;
import com.snail.service.BizTaskAuditService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/auditTask")
@RestController
public class BizAuditTaskController {
    @Resource
    private BizTaskAuditService bizTaskAuditService;

    /**
     * 添加审核任务
     * @param request
     * @return
     */
    @PostMapping("/add")
    public BaseResponse addAuditTask(@RequestBody AddBizTaskAuditRequest request) {
        if (request == null) {
            throw new RuntimeException("请求不能为空");
        }
        bizTaskAuditService.addBizTaskAudit(request);
        return ResultUtils.success();
    }
}
